<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>s</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="/lib/layui-v2.6.3/css/layui.css" media="all">
    <link rel="stylesheet" href="/css/public.css" media="all">
</head>
<body>
<div class="layuimini-container" id="app">
    <div class="layuimini-main">
        <div class="layui-form" id="thisForm">
            <div class="layui-form-item">
                <label class=" layui-form-label">ID：</label>
                <div class="layui-input-inline">
                    <div class="layui-form-mid">{{detail.id}}</div>
                </div>
            </div>
            <div class="layui-form-item">
                <label class=" layui-form-label">区服：</label>
                <div class="layui-input-inline">
                    <div class="layui-form-mid">{{detail.game_area}}</div>
                </div>
            </div>
            <!-- game_areas -->
            <div class="layui-form-item">
                <label class=" layui-form-label">角色id:</label>
                <div class="layui-input-inline">
                    <div class="layui-form-mid">{{detail.role_ids.join(',')}}</div>
                </div>
            </div>

            <div class="layui-form-item">
                <label class=" layui-form-label">标题：</label>
                <div class="layui-input-inline">
                    <div class="layui-form-mid">{{detail.title}}</div>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">描述：</label>
                <div class="layui-input-block">
                    <div class="layui-form-mid">{{detail.description}}</div>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">装备列表：</label>
                <div class="layui-input-block">
                    <div v-for="(item,index) in detail.send_items"> <!--  { equipId, equipLevel,equipBind,holeNum,sendNum,attribute:[],gem:[],ore:[],} -->

                        <div class="layui-form-mid" style="float: unset !important;">
                            {{item.equip_id}}:{{getEquipNameById(item.equip_id)}}
                            &nbsp;&nbsp;精炼等级:{{item.equip_level}}
                            &nbsp;&nbsp;绑定:{{item.equip_bind?'是':'否'}}
                            &nbsp;&nbsp;孔数:{{item.hole_num}}
                            &nbsp;&nbsp;数量: {{item.send_num}}
                        </div>

                        <div   class="attr-box" style="padding-left: 2em;" >
                            仙魂珠:
                            &nbsp;{{item.fsbAttr}}
                            &nbsp;

                        </div>

                        <div class="attr-box" style="padding-left: 2em;">
                            <div>
                                属性: <span v-for="item1 in item.attribute">&nbsp;&nbsp;{{getAttrNameById(item1.id)}}:{{item1.value}}</span>
                            </div>
                            <div>
                                矿石: <span v-for="item1 in item.ore">&nbsp;&nbsp;{{getAttrNameById(item1.id)}}:{{item1.value}}</span>
                            </div>
                            <div>
                                宝石: <span v-for="item1 in item.gem">&nbsp;&nbsp;{{getGemNameById(item1.id)}}:{{item1.value}}</span>
                            </div>

                        </div>

                    </div>

                </div>
            </div>
        </div>
    </div>
</div>
</body>
</html>
<script src="/lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
<script src="/js/common.js?v=5" charset="utf-8"></script>
<script>
    Id = urlParam("id")
    var services = JSON.parse(localStorage.getItem('services'))
    layui.use(['laydate','form','laytpl'], function () {
        var laydate = layui.laydate,form = layui.form,$ = layui.$,laytpl=layui.laytpl;
        laydate.render({
            elem: '#count-down',
            type: 'datetime',
            trigger: 'click'
        });

        new Vue({
            el:"#app",
            data:{
                services:services,
                equipList:getEnum('equip'),
                equipAttrs:getEnum('equipAttr'),
                gemList:getEnum('gemList'),
                itemAttributes:[],
                detail:{
                    role_ids:[],
                    send_items:[],
                }
            },
            computed: {
                parsedFsbAttr() {
                    try {
                        return JSON.parse(this.item.fsbAttr);
                    } catch (error) {
                        // 处理解析错误，例如返回空对象或显示错误信息
                        console.error('解析fsbAttr时出错:', error);
                        return {};
                    }
                }
            },

        methods:{
                getEquipNameById:function(id){
                    for(var k in this.equipList){
                        var v = this.equipList[k];
                        if (v.id == id){
                            return v.name;
                        }
                    }
                    return '无此道具';
                },
                getAttrNameById:function(id){
                    for(var k in this.equipAttrs){
                        var v = this.equipAttrs[k];
                        if (v.id == id){
                            return v.name;
                        }
                    }
                    return '无';
                },
                getGemNameById:function(id){
                    for(var k in this.gemList){
                        var v = this.gemList[k];
                        if (v.id == id){
                            return v.name;
                        }
                    }
                    return '无';
                },
            },
            updated:function(){
                $('[lay-ignore]').removeAttr('lay-ignore');
                form.render();
            },
            mounted:function(){
                var _this = this;
                $.get("/admin/equipSend/"+Id,{},function(res){
                    if (res.code === 0){
                        _this.detail = res.data;
                        console.log(_this.detail)
                    }
                })
                form.render();
            }
        })
    });
</script>
<style>

    #not-exists-ids{
        padding:20px;
    }
    .layui-table{
        margin:0;
    }
    #table1 td{
        padding-right:15px;
    }
    #table1 tr td{
        padding-top:10px;
    }
    #thisForm{
        display: block;position: relative;z-index:1;
    }

    .select-list .left{
        position: relative;
    }
</style>